//
//  MBProgressHUD+Alert.m
//  CToolBox
//
//  Created by yaoyao on 2017/4/20.

//  Copyright © 2017年 SC. All rights reserved.
//

#import "MBProgressHUD+Alert.h"

@implementation MBProgressHUD (Alert)
+ (MBProgressHUD *)showMessage:(NSString *)message toView:(UIView *)view delay:(NSTimeInterval)time {
    
    if (view == nil) view = [[UIApplication sharedApplication].windows lastObject];
    
    MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:view];
    [view addSubview:HUD];
    HUD.label.text = message;
    HUD.mode = MBProgressHUDModeCustomView;
    [HUD showAnimated:YES];
    [HUD hideAnimated:YES afterDelay:time];
    return HUD;
}
@end
